package com.lebang.feign;

import com.lebang.model.RequestUserInfo;
import com.lebang.model.back.Result;
import com.lebang.feign.fallback.WalkEarnedFallback;
import com.lebangweb.response.JsonData;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "wangzhuan-earns", contextId = "wangzhuan-earns-walk",fallback = WalkEarnedFallback.class)
public interface WalkEarnedFeign {
    /**
     * 获取走路阶段完成信息
     *
     * @return
     */
    @PostMapping("/walk/getWalkConfig")
    JsonData getWalkConfig(@RequestBody RequestUserInfo request);


    @ApiOperation("走路赚配置记录添加")
    @PostMapping("/walk/addDataRecord")
    Result<Long> data(@RequestBody RequestUserInfo request, @ApiParam(name = "配置id") @RequestParam("configId") Integer configId);

    @ApiOperation("走路赚领奖")
    @PostMapping("/walk/pull")
    Result<Integer> pull(@RequestBody RequestUserInfo request,
                                @ApiParam(name = "配置id") @RequestParam("recordId") Long recordId);
}
